<%--
  Created by IntelliJ IDEA.
  User: 23333
  Date: 2023/4/8
  Time: 10:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>管理员首页</title>
</head>
<body>
<h1>管理员首页</h1>
<h2>欢迎您：${sessionScope.user.username}</h2>
<a href="/admin/add.jsp">添加商品</a>
<table border="1px">
    <tr>
        <th>ID</th>
        <th>TITLE</th>
        <th>PRICE</th>
        <th>OPERATIONS</th>
    </tr>

    <c:forEach items="${sessionScope.commodityList}" var="commodity">
        <tr>
            <td>${commodity.id}</td>
            <td>${commodity.title}</td>
            <td>${commodity.price}</td>
            <td colspan="3">
                <a href="/commodity/delete/${commodity.id}">删除</a>
                <a href="/commodity/query/${commodity.id}">详情</a>
                <a href="/commodity/alter/${commodity.id}">修改</a>
            </td>
        </tr>
    </c:forEach>
</table>
<a href="/user/loginOut">退出登录</a>

</body>
</html>
